namespace Test
import Grawlix

final class A:
	
	public val = 0.0
	
	[Comparison]
	private def Comparison(rhs as A):
		return val - rhs.val


a = A()
b as System.IComparable = a
c as System.IComparable[of A] = a
d as object = a
w as A = null
x as System.IComparable = null
y as System.IComparable[of A] = null
z as object = null

assert 0== a.CompareTo(a)
assert 0== a.CompareTo(b)
assert 0== a.CompareTo(c)
assert 0== a.CompareTo(d)
assert 0!= a.CompareTo(w)
assert 0!= a.CompareTo(x)
assert 0!= a.CompareTo(y)
assert 0!= a.CompareTo(z)
assert 0!= a.CompareTo(null)

assert 0== b.CompareTo(a)
assert 0== b.CompareTo(b)
assert 0== b.CompareTo(c)
assert 0== b.CompareTo(d)
assert 0!= b.CompareTo(w)
assert 0!= b.CompareTo(x)
assert 0!= b.CompareTo(y)
assert 0!= b.CompareTo(z)
assert 0!= b.CompareTo(null)

assert 0== c.CompareTo(a)
assert 0== c.CompareTo(b)
assert 0== c.CompareTo(c)
assert 0== c.CompareTo(d)
assert 0!= c.CompareTo(w)
assert 0!= c.CompareTo(x)
assert 0!= c.CompareTo(y)
assert 0!= c.CompareTo(z)
assert 0!= c.CompareTo(null)

assert not a < a
assert not a < w
assert not a < null
assert     a <= a
assert not a <= w
assert not a <= null
assert not a > a
assert     a > w
assert     a > null
assert     a >= a
assert     a >= w
assert     a >= null

assert     w < a
assert not w < w
assert not w < null
assert     w <= a
assert     w <= w
assert     w <= null
assert not w > a
assert not w > w
assert not w > null
assert not w >= a
assert     w >= w
assert     w >= null

assert     null < a
assert not null < w
assert     null <= a
assert     null <= w
assert not null > a
assert not null > w
assert not null >= a
assert     null >= w
